
import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Test {

	public static void main(String[] args) {
		Test meh = new Test();
		//meh.executor("run", "bin/NotePad.apk", "C:/Users/victo_000/workspace");
		meh.executor("run", "bin/NotePad.apk", "C:/Users/victo_000/workspace/NotePad");

		
	}
	
	public void executor(String command, String pathToApk , String projectPath){
		ProcessBuilder builder = new ProcessBuilder( "cmd", "/c", "calabash-android", command, pathToApk);
		builder.directory( new File(projectPath));
		Process p;
		try {
			p = builder.start();
			Scanner s = new Scanner( p.getInputStream() ).useDelimiter( "\\Z" );
			System.out.println( s.next() );
			s.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}